Macros for classes of trees

Tree descriptions can be produced by macros. This is especially useful for trees which belong to a larger class of trees and which can be specified by some simple parameters. A small library of such macros is provided in the file TreeClasses.tex.

1.
\treesymbol{<node options>}:
This macro produces a triangular tree symbol which can be included in a tree description instead of an external node. Labels for these tree symbols are described as for ordinary nodes. In addition, the options \lvls{<number>} and \slnt{<number>} are provided. \lvls defines the number of levels in the tree over which the triangle extends, and \slnt gives the slant of the sides of the triangle, ranging from 1 (minimal) to 24 (maximal). On the other hand, \treesymbol does not expand to a tree description, because a tree symbol cannot be built from subtrees, and, on the other hand, it is not a node, because it is allowed to extend over several tree levels and therefore has a longer contour than an ordinary node.

2.
\binary{<bin specification>}:
This macro truly expands to a tree description. It produces a complete binary tree, that is, an extended binary tree, where, for a given h, all external nodes appear at level h or h - 1, and all external nodes at level h lie left of those at level h - 1. <bin specification> consists of the following options: \no{<number>} defines the number of internal nodes, with <number> greater than 0, and \squareleaves produces leaves of type square. Defaults are \no{1} and leaves of type circle.

3.
fibonacci{<fib specification>}:
This macro produces a Fibonacci tree. <fib specification> allows for the three options \hght{<number>}, \unarynodes, and \squareleaves. Normally, a Fibonacci tree of height h + 2 is a binary tree with Fibonacci trees of height h and h + 1 as left and right subtrees. The option \unarynodes means that the Fibonacci tree is augmented by unary nodes such that each two subtree siblings have the same height. These are examples of what has been called brother-trees in the literature; see [12]. Defaults are \hght{0}, the unaugmented version of a Fibonacci tree, and external nodes of type circle.